package com.yfh.study.manager.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yfh.data.base.utils.QfBeanUtils;
import com.yfh.data.system.dataManager.vo.input.MyPlayStatusInput;
import com.yfh.data.system.entity.Play;
import com.yfh.study.manager.dao.PlayDao;
import com.yfh.study.manager.service.PlayService;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 计划表(Play)表服务实现类
 *
 * @author makejava
 * @since 2022-09-06 20:28:21
 */
@Service("playService")
public class PlayServiceImpl extends ServiceImpl<PlayDao, Play> implements PlayService {

    /**
     * 查询所有信息
     * @return
     */
    @Override
    public List<Play> queryList() {
        return super.query().list();
    }

    /**
     * 修改信息
     * @param myPlayStatusInput
     * @return
     */
    @Override
    public boolean updateStatus(MyPlayStatusInput myPlayStatusInput) {
        Play play = QfBeanUtils.beanCopy(myPlayStatusInput, Play.class);
        return super.updateById(play);
    }

    /**添加计划
     *
     * @param ufunction
     * @return
     */
    @Override
    public boolean addPlay(String ufunction) {
        Play play=new Play();
        play.setUfunction(ufunction);
        play.setUCurrentTime(new Date());
        return super.save(play);
    }

    /**
     * 删除计划
     * @param id
     * @return
     */
    @Override
    public boolean deletePlay(Integer id) {
        return super.removeById(id);
    }
}

